import 'package:flutter/material.dart';
import 'package:hotfil_pub_web/widgets/IconFontIcons.dart';
import 'package:hotfil_pub_web/widgets/my_theme.dart';

class HomeMenuBarItem extends StatelessWidget {
  final IconData iconData;
  final String text;

  const HomeMenuBarItem(
    this.iconData,
    this.text, {
    Key? key,
  }) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return InkWell(
      child: Column(
        children: [
          Icon(
            iconData,
            color: MyTheme.primaryColor,
            size: 28,
          ),
          const SizedBox(
            height: 5,
          ),
          Text(
            text,
            style: TextStyle(color: MyTheme.mainTextColor, fontSize: 12),
          )
        ],
      ),
      onTap: () {
        print('点击产品');
      },
    );
  }
}

class HomeMenuBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: [
          HomeMenuBarItem(IconFontIcons.iconTibi1, '产品'),
          HomeMenuBarItem(IconFontIcons.iconTibi1, '订单'),
          HomeMenuBarItem(IconFontIcons.iconTibi1, '提币'),
          HomeMenuBarItem(IconFontIcons.iconTibi1, '充值'),
        ],
      ),
    );
  }
}
